package com.woniu02;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;

public class Test01 {
    public static void main(String[] args) {

        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

//        TemporalAccessor temporalAccessor = dtf.parse("2020-01-02 12:34:56");
//        System.out.println(temporalAccessor);
//        LocalDateTime dateTime = LocalDateTime.from(temporalAccessor);
//        System.out.println(dateTime);

        LocalDateTime dateTime1 = LocalDateTime.parse("2020-01-02 12:34:14",dtf);
        System.out.println(dateTime1);
    }
}
